<?xml version="1.0" encoding="utf-8"?>
<mx:Module layout="vertical"
	width="970" height="562" styleName="bodyModule"
	xmlns:mx="http://www.adobe.com/2006/mxml"
	updateComplete="updateLanguage()"
	creationComplete="init()">
	

	<mx:Script source="../../../controller/access/LoginController.as" />
	
	
	<mx:VRule height="30" visible="false"/>
	
    <mx:ApplicationControlBar width="100%" height="80" styleName="loginBar">
    	<mx:VBox verticalGap="0">
	        <mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'titleLogin')}" styleName="clearTitle5"/>
	        <mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'titleLogin2')}" styleName="clearTitle2"/>
    	</mx:VBox>
    </mx:ApplicationControlBar>
    
    <mx:VRule height="20" visible="false"/>
    
    <!--
	<mx:Dissolve id="dissolveOut" duration="250" alphaFrom="1.0" alphaTo="0.5"/>
    <mx:Dissolve id="dissolveIn" duration="250" alphaFrom="0.5" alphaTo="1.0"/>
    -->
    
    <mx:HBox width="100%" styleName="loginCenterPanel">
    	<mx:Image width="471" height="254" source="main/resources/images/login_image.jpg"/>
    	<mx:ViewStack id="loginStack" width="350" paddingTop="10">
	    	<!-- Login View -->
	    	<mx:VBox verticalGap="0" paddingTop="0" updateComplete="resetLoginErrorMsg()">
	    		<mx:HBox height="20" verticalAlign="middle" horizontalGap="2">
	    			<mx:Image width="16" height="14" id="modeIcon" visible="false" source = "main/resources/images/BALANCE.png" verticalAlign="bottom"/>
    				<mx:Label width="325" id="keyMsg" height="20" styleName="darkText"/>
    			</mx:HBox>
	    		<mx:HRule visible="false" height="20"/>
	    		<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'fieldLogin')}"/>
	    		<mx:TextInput id="txLogin" enter="login(event)" maxChars="50"/>
	    		<mx:VRule visible="false" height="5"/>
	    		
	    		<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'fieldPassword')}"/>
	    		<mx:HBox>
	    			<mx:TextInput id="txPassword" displayAsPassword="true" enter="login(event)" maxChars="50"/>
	    			<mx:Button label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnSignIn')}" click="login(event)" width="50"/>		
	    		</mx:HBox>
	 			<mx:VRule visible="false" height="5"/>
	 			
	 			<mx:CheckBox id="chkRemember" label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'fieldRemember')}"/>
	 			<mx:VRule visible="false" height="5"/>
	 			
	 			<mx:Text styleName="errorText" width="265" id="loginErrorMsg" height="34"/>
	 			<mx:HRule visible="false" height="20"/>
	 			
	 			<mx:VBox verticalGap="0" fontSize="10">
	 				<mx:HBox verticalAlign="middle" horizontalGap="3">
	 					<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRequestAccount')}" height="16"/>
	 					<mx:VRule height="10"/>
	 					<mx:LinkButton label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRequestAccount')}"
	 						height="16" click="requestAccount()"/>	
	 				</mx:HBox>
	 				<mx:HBox verticalAlign="middle" horizontalGap="3">
	 					<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecoverPassword')}" height="16"/>
	 					<mx:VRule height="10"/>
	 					<mx:LinkButton label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecoverPassword')}"
	 						height="16" click="requestPassView()"/>	
	 				</mx:HBox>
	 			</mx:VBox>
	    	</mx:VBox>
	    	<!-- Recover Password View -->
	    	<mx:VBox verticalGap="0" paddingTop="30" updateComplete="resetRecPassErrorMsg()">
	    		<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'titleRecoverPassword')}" styleName="darkTitle2"/>
	    		<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPasRecoverPassword')}"/>
	    		<mx:VRule height="20" visible="false"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassFieldEmail')}"/>
				<mx:TextInput id="txEmail" width="208" maxChars="255" enter="requestPassword(event)"/>
	 			<mx:HBox paddingTop="10" paddingBottom="5">
	 				<mx:Button label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecPassRecover')}"
	 					click="requestPassword(event)" width="100"/>
	 				<mx:Button label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecPassBackToLogin')}"
	 					click="goBackLogin()" width="100"/>
	 			</mx:HBox>
	 			<mx:Text styleName="errorText" width="265" id="recoverErrorMsg" height="34"/>
	    	</mx:VBox>
	    	<!-- Recover Password Success -->
	    	<!--<mx:VBox horizontalAlign="center" paddingTop="30">
				<mx:Image width="59" height="59" source="main/resources/images/ICON_SUCCESS.png"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassSuccess')}"
					styleName="darkTitle"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassCheckEmail')}"/>
				<mx:LinkButton label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecPassBackToLogin')}"
					click="goBackLogin()"/>
			</mx:VBox>-->
			<!--Asynchronous Call Screen-->
			<mx:VBox horizontalAlign="center" verticalGap="0" paddingTop="30">
				<mx:Label id="asyncCallScreenTitle" styleName="darkTitle2"/>
				<mx:VRule height="50" visible="false"/>				
				<mx:Image width="35" height="35" source="main/resources/images/POPUP_ICON_LOADING.gif"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblWaitWhileValidating')}" styleName="darkTitle2"/>
			</mx:VBox>
			<!--Recover Password - Update Password-->
			<mx:VBox verticalGap="0" paddingTop="40">
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'titleRecoverPassword')}" styleName="darkTitle2"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassTypePass')}"/>
				<mx:VRule height="10" visible="false"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassPassword')}"/>
				<mx:TextInput id="rpTxPass1" width="180" maxChars="50" displayAsPassword="true"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassPasswordConfirm')}"/>
				<mx:HBox>
					<mx:TextInput id="rpTxPass2" width="180" maxChars="50" displayAsPassword="true"/>
					<mx:Button label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecPassChangePassword')}" width="60" click="updatePassword()"/>
				</mx:HBox>
				<mx:VRule height="5" visible="false"/>
				<mx:Text styleName="errorText" width="265" id="recoverChangeErrorMsg" height="34"/>
			</mx:VBox>
	    	<!--Recover Password - Update Password Success-->
	    	<!--<mx:VBox horizontalAlign="center" paddingTop="30">
				<mx:Image width="59" height="59" source="main/resources/images/ICON_SUCCESS.png"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassSuccess')}"
					styleName="darkTitle"/>
				<mx:Label text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'lblRecPassCheckEmail')}"/>
				<mx:LinkButton label="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'btnRecPassBackToLogin')}"
					click="goBackLogin()"/>
			</mx:VBox>-->
    	</mx:ViewStack>
    </mx:HBox>
    
    <mx:VRule height="15" visible="false"/>
    
    <mx:HBox>
    	<mx:Text text="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'textNdgDescription')}"
    		styleName="darkTitle" width="970" height="80" fontWeight="normal"/>	
    </mx:HBox>
	
	<mx:Array id="loginValidators">
		<mx:StringValidator source="{txLogin}" property="text"
			required="true" requiredFieldError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'requiredFieldMsg')}"
			triggerEvent="change"/>
		<mx:StringValidator source="{txPassword}" property="text"
			required="true" requiredFieldError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'requiredFieldMsg')}"
			triggerEvent="change"/>
	</mx:Array>
	
	<mx:Array id="recPassValidators">
		<mx:EmailValidator source="{txEmail}" property="text"
			required="true" requiredFieldError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'requiredFieldMsg')}"
			invalidCharError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'invalidCharEmailErrorMsg')}"
			invalidDomainError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'invalidDomainEmailErrorMsg')}"
			invalidIPDomainError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'invalidIPDomainEmailErrorMsg')}"
			invalidPeriodsInDomainError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'invalidPeriodsInDomainEmailErrorMsg')}"
			missingAtSignError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'missingAtSignEmailErrorMsg')}"
			missingPeriodInDomainError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'missingPeriodInDomainEmailErrorMsg')}"
			missingUsernameError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'missingUsernameEmailErrorMsg')}"
			tooManyAtSignsError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'tooManyAtSignsEmailErrorMsg')}"
			triggerEvent="change"/>	
	</mx:Array>
	
	<mx:Array id="updatePassValidators">
		<mx:StringValidator source="{rpTxPass1}" property="text"
			required="true" requiredFieldError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'requiredFieldMsg')}"
			triggerEvent="change"/>
		<mx:StringValidator source="{rpTxPass2}" property="text"
			required="true" requiredFieldError="{resourceManager.getString(ConfigI18n.LOCALE_FILE, 'requiredFieldMsg')}"
			triggerEvent="change"/>		
	</mx:Array>	


</mx:Module>


